package com.jhws.business.advertisement.bo;

import com.jhws.common.base.bo.BaseBo;
import com.jhws.util.DateUtil;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;

@Table(name = "tbl_notice_dim")
@Entity
public class TblNoticeDimBo extends BaseBo {

    /**
     * 序列化
     */
    private static final long serialVersionUID = 2706112875815047937L;

    public static final String RESI_GRPID = "3402223969890";
    @Id
    @Column(name = "notice_code")
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    private String noticeCode;//主键
    @Column(name = "titile")
    private String titile; //通知标题
    @Column(name = "context")
    private String context; //通知内容
    @Column(name = "create_time")
    private Date createTime; //通知创建时间
    @Column(name = "create_usr")
    private String createUsr; //创建人
    @Column(name = "begin_date")
    private Date beginDate; //展示开始时间
    @Column(name = "end_date")
    private Date endDate; // 展示结束时间
    @Column(name = "equ_type")
    private String equType; //通知的设备对象，编号
    @Column(name = "notice_type")
    private String noticeType; //通知类型（小区通知，房号通知）
    @Column(name = "user_code")
    private String userCode; //通知创建人数据库主键
    @Column(name = "comm_code")
    private String commCode; //小区编号
    @Column(name = "state", columnDefinition = "INT default 0")
    private int state; //状态 0：正常 1：删除

    @Column(columnDefinition = "BIGINT(20) default 1")
    private Long timestamp;

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public String getNoticeCode() {
        return noticeCode;
    }

    public void setNoticeCode(String noticeCode) {
        this.noticeCode = noticeCode;
    }

    public String getTitile() {
        return titile;
    }

    public void setTitile(String titile) {
        this.titile = titile;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCreateUsr() {
        return createUsr;
    }

    public void setCreateUsr(String createUsr) {
        this.createUsr = createUsr;
    }

    public String getBeginDate() {
        return DateUtil.timestamp2String(beginDate.getTime(),DateUtil.DATE_FORMAT);
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Date getEndDate() {
        return this.endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public String getEquType() {
        return equType;
    }

    public void setEquType(String equType) {
        this.equType = equType;
    }

    public String getNoticeType() {
        return noticeType;
    }

    public void setNoticeType(String noticeType) {
        this.noticeType = noticeType;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getCommCode() {
        return commCode;
    }

    public void setCommCode(String commCode) {
        this.commCode = commCode;
    }
}
